/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package library.book;

/**
 *
 * @author MonStar
 */
public class Book {

    private Integer id;
    private String name = "no name";
    private String autor = "no autor";
    private Integer year = 0;
    private String link = "no link";
    private final Byte numberFieldsBook = 5;

    public String getAutor() {
        return autor;
    }

    public void setAutor(String autor) {
        this.autor = autor;
    }

    public Integer getId() {
        return id;
    }

    public void setId() {        
        this.id = SetID.getInstanceID().setID();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getYear() {
        return year;
    }

    public void setYear(Integer year) {
        this.year = year;
    }

    public String getLink() {
        return link;
    }

    public void setLink(String link) {
        this.link = link;
    }

    @Override
    public String toString() {
        return id + ". " + name + " - " + autor + " - " + year + " - URL = " + link;
    }

    public String[] infoBook() {
        String[] infoBook = new String[numberFieldsBook];
        infoBook[0] = id.toString();
        infoBook[1] = name.toString();
        infoBook[2] = autor.toString();
        infoBook[3] = year.toString();
        infoBook[4] = link.toString();
        return infoBook;
    }
}
